package com.example.base.net

import com.blankj.utilcode.util.SPUtils
import okhttp3.Interceptor
import okhttp3.Response

/**
 * token拦截器
 */
class TokenInterceptor:Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        val token = SPUtils.getInstance().getString(Cons.SP_TOKEN)
        val request = chain.request().newBuilder()
            .addHeader("token", token)
            .addHeader("accessId", "5b8ffd402abf4416923f251321b50af4")
            .build()
        return chain.proceed(request)
    }
}